Mule : Jmx Management
This page last changed on Aug 07, 2006 by tcarlson.
The Mule Jmx agent enables the configuration of a local or remote Jmx connection to Mule and registers Mule resources with the MBean server. With Jmx enabled you can do the following against a local or remote instance -
To configure the agent with Mule use the following configuration - <agents> <agent name="JmxAgent" className="org.mule.management.agents.JmxAgent"/> </agents> You can set the following properties on the agent.
Remote ManagementIt's also possible to configure the Mule JMX subsystem for remote management with 3rd-party tools like MC4J: <agents> <!-- starts an RMI registry on the default port 1099. --> <agent name="RMI" className="org.mule.management.agents.RmiRegistryAgent"/> <agent name="JMX" className="org.mule.management.agents.JmxAgent"> <properties> <property name="connectorServerUrl" value="service:jmx:rmi:///jndi/rmi://localhost:1099/server"/> <map name="connectorServerProperties"> <property name="jmx.remote.jndi.rebind" value="true"/> </map> </properties> </agent> <agents> Running an External RMI ServerIf you are using JDK1.4 and running the RMI Registry externally using rmiregistry.exe (Bundled with JDK 1.4) you will need to add the JMX remoting Jar to your JDK classpath in order for the external RMI registry to serve Remote JMX clients. This isn't an issue if running with JDK 1.5 as the JMX remoting classes are now part of the JDK. Jmx Adapter AgentsIn addition to the JmxAgent you can configure other agents to configure Jmx Adaptors or register supporting MBeans. Mule currently ships with two Jmx Adaptor agents: Mx4j and Jdmk. Mx4j ConfigurationTo configure Mule to use the Mx4j Html Adaptor - <agents> <agent name="JmxAgent" className="org.mule.management.agents.JmxAgent"/> <agent name="Mx4jAgent" className="org.mule.management.agents.Mx4jAgent"> <properties> <property name="jmxAdaptorUrl" value="http://localhost:9999"/> </properties> </agent> </agents> http://localhost:9999 is the default URL and can be ommitted if there's no need to change it.
Mx4j SecurityAs of Mule 1.3 it is possible to protect the JMX web console with a login and password. If the login property has been specified, the protection scheme kicks in: <agents> <agent name="jmxAgent" className="org.mule.management.agents.JmxAgent"/> <agent name="mx4jAgent" className="org.mule.management.agents.Mx4jAgent"> <properties> <property name="login" value="user"/> <property name="password" value="password"/> </properties> </agent> </agents> By default, the BASIC authentication scheme is used. As of Mule 1.3 SSL protection is also available: <agents> <agent name="jmxAgent" className="org.mule.management.agents.JmxAgent"/> <agent name="mx4jAgent" className="org.mule.management.agents.Mx4jAgent"> <properties> <map name="socketFactoryProperties"> <property name="keyStoreName" value="serverKeystore"/> <property name="keyStorePassword" value="mulepassword"/> </map> </properties> </agent> </agents>
If socketFactoryProperties contains at least one entry, the agent will switch to HTTPS connections.
Jdmk ConfigurationTo configure Mule to use the Jdmk Html Adaptor - <agents> <agent name="JmxAgent" className="org.mule.management.agents.JmxAgent"/> <agent name="JdmkAgent" className="org.mule.management.agents.JdmkAgent"> <properties> <property name="jmxAdaptorUrl" value="http://localhost:9998"/> </properties> </agent> </agents> Viewing StatisticsMule traps many different statistics about the running state of a server and number of events processed. With the Jdmk Html adaptor you can view the Mule statistics html report. To view the statistics report shown below using the above configuration go to the following url - http://localhost:9998/InvokeAction//Mule%3Atype%3Dstatistics/action= printHtmlSummary?action=printHtmlSummary or from the Jmx console homepage - http://localhost:9998 -> 'Mule:type=statistics' -> 'printHtmlSummary'
Other Management AgentsLog4J AgentThe log4j Agent exposes the configuration of the Log4J instance used by Mule for Jmx management. <agents> <agent name="JmxAgent" className="org.mule.management.agents.JmxAgent"/> <agent name="Log4jAgent" className="org.mule.management.agents.Log4jAgent"/> </agents>
Default JMX Support AgentYou can configure all Jmx Agents with a single class called DefaultJmxSupportAgent. It will register your Mule instance with the following agents -
Just add the following to your configuration - <agent name="JMX" className="org.mule.management.agents.DefaultJmxSupportAgent"/>
The agent does a lot of useful plumbing for JMX, however at the expense of defaulting many parameters. If you find a need to customize some subsystems you could either:
|
Document generated by Confluence on Nov 27, 2006 10:27 |